﻿using System;
using System.Diagnostics;
using System.Linq.Expressions;
using System.Reflection;

namespace Awesome.Extensions.Reflection
{

    /// <summary>
    /// Provides type-safe reflection and come stack frame helpers.
    /// </summary>
    public static class Method<TResult>
    {[DebuggerStepThrough]
            public static MethodInfo Of(Func<TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1>(Func<T1, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1, T2>(Func<T1, T2, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1, T2, T3>(Func<T1, T2, T3, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1, T2, T3, T4>(Func<T1, T2, T3, T4, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1, T2, T3, T4, T5>(Func<T1, T2, T3, T4, T5, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1, T2, T3, T4, T5, T6>(Func<T1, T2, T3, T4, T5, T6, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7>(Func<T1, T2, T3, T4, T5, T6, T7, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8>(Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult> f)
            {
                return MethodInfoProvider.FromDelegate(f);
            }[DebuggerStepThrough]
            public static MethodInfo Of<TClass>(Expression<Func<TClass, Func<TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1>(Expression<Func<TClass, Func<T1, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1, T2>(Expression<Func<TClass, Func<T1, T2, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1, T2, T3>(Expression<Func<TClass, Func<T1, T2, T3, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1, T2, T3, T4>(Expression<Func<TClass, Func<T1, T2, T3, T4, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1, T2, T3, T4, T5>(Expression<Func<TClass, Func<T1, T2, T3, T4, T5, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6>(Expression<Func<TClass, Func<T1, T2, T3, T4, T5, T6, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7>(Expression<Func<TClass, Func<T1, T2, T3, T4, T5, T6, T7, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8>(Expression<Func<TClass, Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8, T9>(Expression<Func<TClass, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Expression<Func<TClass, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Expression<Func<TClass, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Expression<Func<TClass, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Expression<Func<TClass, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Expression<Func<TClass, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
[DebuggerStepThrough]
            public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Expression<Func<TClass, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult>>> e)
            {
                return  MethodInfoProvider.FromExpression(e);
            }
    }

    public static partial class Method
    {
        [DebuggerStepThrough]
        public static MethodInfo Of(Action a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1>(Action<T1> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1, T2>(Action<T1, T2> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1, T2, T3>(Action<T1, T2, T3> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1, T2, T3, T4>(Action<T1, T2, T3, T4> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1, T2, T3, T4, T5, T6>(Action<T1, T2, T3, T4, T5, T6> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7>(Action<T1, T2, T3, T4, T5, T6, T7> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8>(Action<T1, T2, T3, T4, T5, T6, T7, T8> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
            Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(
            Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(
            Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(
            Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(
            Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(
            Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> a)
        {
            return MethodInfoProvider.FromDelegate(a);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass>(Expression<Func<TClass, Action>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1>(Expression<Func<TClass, Action<T1>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1, T2>(Expression<Func<TClass, Action<T1, T2>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1, T2, T3>(Expression<Func<TClass, Action<T1, T2, T3>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1, T2, T3, T4>(Expression<Func<TClass, Action<T1, T2, T3, T4>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1, T2, T3, T4, T5>(Expression<Func<TClass, Action<T1, T2, T3, T4, T5>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6>(
            Expression<Func<TClass, Action<T1, T2, T3, T4, T5, T6>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7>(
            Expression<Func<TClass, Action<T1, T2, T3, T4, T5, T6, T7>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8>(
            Expression<Func<TClass, Action<T1, T2, T3, T4, T5, T6, T7, T8>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8, T9>(
            Expression<Func<TClass, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
            Expression<Func<TClass, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(
            Expression<Func<TClass, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(
            Expression<Func<TClass, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(
            Expression<Func<TClass, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(
            Expression<Func<TClass, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }

        [DebuggerStepThrough]
        public static MethodInfo Of<TClass, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(
            Expression<Func<TClass, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>>> e)
        {
            return MethodInfoProvider.FromExpression(e);
        }
    }
}